package com.base.service.impl;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.base.mapper.voipmapper.SelfShopMapper;
import com.base.po.voip.SelfShop;
import com.base.po.voip.SelfShopExample;
import com.base.service.SelfShopService;
import com.base.utils.Page;

@Service("selfShopService")
public class SelfShopServiceImpl implements SelfShopService {

    @Autowired
    private SelfShopMapper selfShopMapper;

    @Override
    public int countByExample(SelfShopExample example) {

        return selfShopMapper.countByExample(example);
    }

    @Override
    public int deleteByExample(SelfShopExample example) {

        return selfShopMapper.deleteByExample(example);
    }

    @Override
    public int insert(SelfShop record) {

        return selfShopMapper.insert(record);
    }

    @Override
    public int insertSelective(SelfShop record) {

        return selfShopMapper.insertSelective(record);
    }

    @Override
    public List<SelfShop> selectByExample(SelfShopExample example) {

        return selfShopMapper.selectByExample(example);
    }

    @Override
    public SelfShop selectByPrimaryKey(String id) {
        if (id == null || id.isEmpty()){
            return null;
        }
        return selfShopMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<SelfShop> selectBySelfShop(String parentid, String shopid) {

        return selfShopMapper.selectBySelfShop(parentid, shopid);
    }

    @Override
    public int updateByExampleSelective(SelfShop record, SelfShopExample example) {

        return selfShopMapper.updateByExampleSelective(record, example);
    }

    @Override
    public int updateByExample(SelfShop record, SelfShopExample example) {

        return selfShopMapper.updateByExample(record, example);
    }

    @Override
    public int updateByPrimaryKeySelective(SelfShop record) {

        return selfShopMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int countSort(String parentid) {
        return selfShopMapper.countSort(parentid);
    }

    @Override
    public List<SelfShop> selectAll(Page page, String parentid, String shopname, Byte isopen) {

        return selfShopMapper.selectAll(page, parentid, shopname, isopen);
    }

    @Override
    public List<SelfShop> selectAllShop(Page page, String parentid, String cid, String shopname, Byte ischoice, String start, String end, Boolean sort, String city, String district) {
        return selfShopMapper.selectAllShop(page, parentid, cid, shopname, ischoice, start, end, sort, city, district);
    }

    @Override
    public int countAll(String parentid, String shopname, Byte isopen) {

        return selfShopMapper.countAll(parentid, shopname, isopen);
    }

    @Override
    public int countAllShop(String parentid, String cid, String shopname, Byte ischoice, String start, String end, Boolean sort, String city, String district) {
        return selfShopMapper.countAllShop(parentid, cid, shopname, ischoice, start, end, sort, city, district);
    }

    @Override
    public SelfShop selectByName(String selfShopName) {
        return selfShopMapper.selectByName(selfShopName);
    }


    @Override
    public List<SelfShop> selectByNearby(String parentid, String cid, BigDecimal latitude, BigDecimal longitude, Boolean sort, Integer distanceStart, Integer distanceEnd) {

        return selfShopMapper.selectByNearby(parentid, cid, latitude, longitude, sort, distanceStart, distanceEnd);
    }


}
